﻿using System;
using System.Collections.Generic;
using System.Text;
using Cos.Core.Module.Response;

namespace Cos.Module.Security.Admin
{
    public interface ISecurityController
    {
        /**
    * Checks if the user is authenticated
    * 
    * @return true if the user is authenticated, false otherwise
    */
        //@Secured({ AuthenticatedVoter.IS_AUTHENTICATED_ANONYMOUSLY })
        //@CosJsonMethod(description = "Checks if the user is authenticated")
        CameleonResult<bool> IsAuthenticated();

        /**
         * Logs in the user into the system
         * 
         * @param username The user name
         * @param password The password
         */
        //@Secured({ AuthenticatedVoter.IS_AUTHENTICATED_ANONYMOUSLY })
        //@CosJsonMethod(description = "Logs in the user into the system")
        CameleonResult Login(/*@CosJsonParameter("username")*/ string username, /*@CosJsonParameter("password")*/ string password);

        /**
         * Logs out the user from the system
         * 
         * @return returns true if the logout was successful, false otherwise
         */
        //@Secured({ AuthenticatedVoter.IS_AUTHENTICATED_FULLY })
        //@CosJsonMethod(description = "Logs out the user from the system")
        CameleonResult Logout();

        /**
         * Send the new password to the user.
         * 
         * @param username The user partial credentials
         * @param email The user's email address
         */
        //@Secured({ AuthenticatedVoter.IS_AUTHENTICATED_ANONYMOUSLY })
        //@CosJsonMethod(description = "Send the new password to the user.")
        CameleonResult ForgotPassword(/*@CosJsonParameter("username")*/ string username, /*@CosJsonParameter("email")*/ string email);

        /**
         * Changes the current user's password
         * 
         * @param oldPassword The current (old) user password
         * @param newPassword The (new) password to set
         */
        //@Secured({ AuthenticatedVoter.IS_AUTHENTICATED_FULLY })
        //@CosJsonMethod(description = "Changes the current user's password")
        CameleonResult ChangePassword(/*@CosJsonParameter("oldPassword")*/ string oldPassword, /*@CosJsonParameter("newPassword")*/ string newPassword);

        /**
         * List the services that are available
         * 
         * @return The services that are available
         */
        //@Secured({ AuthenticatedVoter.IS_AUTHENTICATED_FULLY })
        //@CosJsonMethod(description = "List the services that are available")
        CameleonResult<IEnumerable<ShortCosPluginMsg>> ListAvailableServices();
    }
}
